import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from './router/index'
import store from './store'
import './assets/styles/style.css'
import axios from 'axios'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import VCharts from 'v-charts'

//Vue.prototype.$axios=axios
Vue.prototype.$http=axios.create({
  baseURL: "http://localhost:3000"
})

Vue.mixin({
  methods: {
    $get(url,data){
      //return axios.get('http://47.92.50.43:8888'+url,{
        return axios.get('http://localhost:3000'+url,{
        params:data
      })
    },
    $put(url, data) {
      return axios.put('http://localhost:3000' + url, {
        params: data
      })
    },
    $deletee(url, data) {
      return axios.delete('http://localhost:3000' + url, {
        params: data
      })
    }
  },
})
Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(ViewUI);
Vue.use(VCharts);

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
